import {useColumns,useFormWrapper, CrudOptions, AddReq, DelReq, EditReq, dict, CrudExpose, UserPageQuery, CreateCrudOptionsRet,importTable } from '@fast-crud/fast-crud';
import _ from 'lodash-es';
import * as api from './api';
import { request } from '/@/utils/service';
import {auth} from "/@/utils/authFunction";
import { ca, fa } from 'element-plus/es/locale';
import {dictionary} from '/@/utils/dictionary';
import {formatDate} from '/@/utils/formatTime';
import { ElDialog, ElMessage, ElMessageBox } from "element-plus";
import { ref } from "vue";

function batchModifyForm(crudExpose: CrudExpose) {	
	// 自定义表单配置
	const { buildFormOptions } = useColumns();
	const customOptions: CrudOptions = {
	  columns: {
		disposal_subject: {
			title: '处置主体',
			type: 'dict-select',
			dict: dict({
				url: '/api/DisposalSubjectModelViewSet/',
				value: 'disposal_subject_id',
				label: 'disposal_subject_name',
			}),				
			form: {						
				rules: [{ required: true, message: '处置主体必填' }],
				component: {
					filterable: true,
					placeholder: '请输入处置主体',
				},
			},
		},
		commission_company: {
			title: '委案公司',
			type: 'dict-select',
			dict: dict({
				url: '/api/PrincipalModelViewSet/',
				value: 'id',
				label: 'companyname',
			}),			
			form: {
				rules: [{ required: true, message: '委案公司必填' }],
				component: {
					placeholder: '请输入委案公司',
				},
			},
		},                
		commission_batch: {
			title: '委案批次',
			type: 'dict-select',
			dict: dict({
				url: '/api/BatchModelViewSet/',
				value: 'uuid',
				label: 'casebatch',
			}),			
			form: {
				rules: [{ required: true, message: '委案批次必填' }],
				component: {
					placeholder: '请输入委案批次',
				},
			},
		},
		current_stage:{
			title: '当前阶段',
			type: 'input',			
			form: {
				rules: [{ required: true, message: '当前阶段必填' }],
				component: {
					placeholder: '请输入当前阶段',
				},
			},
		},
		current_of:{
			title: '当前状态',
			type: 'input',			
			form: {
				rules: [{ required: true, message: '当前状态必填' }],
				component: {
					placeholder: '请输入当前状态',
				},
			},
		},
	  },
	  form: {
		wrapper: {
		  title: "批量修改",		  
		},		
		doSubmit({ form }) {
		  console.log("form submit:", form);
		  ElMessage.info("自定义表单提交:" + JSON.stringify(form));
		  ElMessage.warning("抛出异常可以阻止表单关闭");
		  // throw new Error("抛出异常可以阻止表单关闭");
		}
	  }
	};
  
	
  
	const openCustomForm = async (ids:any) => {
	  const formOptions = buildFormOptions(customOptions);	 
	  formOptions.initialForm = { ids };
	  formOptions.newInstance = true; //新实例打开
	  const dialogRef = await crudExpose.openDialog(formOptions);	  
	};
  
	return {	  
	  openCustomForm
	};
}

function batchGroupForm(crudExpose: CrudExpose) {	
	// 自定义表单配置
	const { buildFormOptions } = useColumns();
	const customOptions: CrudOptions = {
	  columns: {
		disposal_subject: {
			title: '原告公司',
			type: 'dict-select',
			dict: dict({
				url: '/api/DisposalSubjectModelViewSet/',
				value: 'disposal_subject_id',
				label: 'disposal_subject_name',
			}),				
			form: {						
				rules: [{ required: false, message: '原告公司必填' }],
				component: {
					filterable: true,
					placeholder: '请输入原告公司',
				},
			},
		},
		commission_company: {
			title: '委案公司',
			type: 'dict-select',
			dict: dict({
				url: '/api/PrincipalModelViewSet/',
				value: 'id',
				label: 'companyname',
			}),			
			form: {
				rules: [{ required: false, message: '委案公司必填' }],
				component: {
					placeholder: '请输入委案公司',
				},
			},
		},                
		commission_batch: {
			title: '委案批次',
			type: 'dict-select',
			dict: dict({
				url: '/api/BatchModelViewSet/',
				value: 'uuid',
				label: 'casebatch',
			}),			
			form: {
				rules: [{ required: false, message: '委案批次必填' }],
				component: {
					placeholder: '请输入委案批次',
				},
			},
		},
		acceptance_court:{
			title: '受理法院',
			type: 'dict-select',
			dict: dict({
				url: '/api/CourtsModelViewSet/',
				value: 'courtcode',
				label: 'courtname',
			}),			
			form: {
				rules: [{ required: false, message: '受理法院必填' }],
				component: {
					placeholder: '请输入受理法院',
				},
			},
		},
		group_count:{
			title: '每组数量',
			type: 'number',			
			form: {
				rules: [{ required: true, message: '每组数量必填' }],
				component: {
					placeholder: '请输入每组数量',
				},
				suffixRender({ value }) {
					return "保全分组";
				}
			},
		},
	  },
	  form: {
		wrapper: {
		  title: "批量分组",		  
		},		
		doSubmit({ form }) {
		  console.log("form submit:", form);
		  ElMessage.info("自定义表单提交:" + JSON.stringify(form));
		  ElMessage.warning("抛出异常可以阻止表单关闭");
		  // throw new Error("抛出异常可以阻止表单关闭");
		}
	  }
	};
  
	
  
	const openBatchGroupForm = async (ids:any) => {
	  const formOptions = buildFormOptions(customOptions);	 
	  formOptions.initialForm = { ids };
	  formOptions.newInstance = true; //新实例打开
	  const dialogRef = await crudExpose.openDialog(formOptions);	  
	};
  
	return {	  
		openBatchGroupForm
	};
}
//此处为crudOptions配置
export default function ({ crudExpose}: { crudExpose: CrudExpose}): CreateCrudOptionsRet {
	const { openCustomForm } = batchModifyForm(crudExpose);
	const {openBatchGroupForm} = batchGroupForm(crudExpose);
	const pageRequest = async (query: any) => {
		return await api.GetList(query);
	};
	const editRequest = async ({ form, row }: EditReq) => {
		if (row.id) {  
			form.id = row.id;
		}
		return await api.UpdateObj(form);
	};
	const delRequest = async ({ row }: DelReq) => {
		return await api.DelObj(row.id);
	};
	const addRequest = async ({ form }: AddReq) => {
		return await api.AddObj(form);
	};

    const exportRequest = async (query: UserPageQuery) => {
		return await api.exportData(query);
	};

	const selectedIds = ref([]);

	const onSelectionChange = (changed: { map: (arg0: (item: any) => any) => never[]; }) => {
		console.log("selection", changed);
		selectedIds.value = changed.map((item) => item.id);
	};
	return {
		crudOptions: {
			request: {
				pageRequest,
				addRequest,
				editRequest,
				delRequest,
			},
			toolbar:{
				show:false,
			},
			actionbar: {
				buttons: {
						export:{
                            // 注释编号:django-vue3-admin-crud210716:注意这个auth里面的值，最好是使用index.vue文件里面的name值并加上请求动作的单词
                            show: false,
							text: "导出",//按钮文字
                        	title: "导出",//鼠标停留显示的信息
                            click(){
                                return exportRequest(crudExpose.getSearchFormData())
                            }
                        },
                        add: {
                            show: true,							
                        },
				}
			},
            rowHandle: {
                //固定右侧
                fixed: 'right',
                width: 200,
                buttons: {
                    view: {
                        type: 'text',
                        show: auth('CaseInfoModelViewSet:Retrieve')
                    },
                    edit: {
                        type: 'text',
						show: auth('CaseInfoModelViewSet:Update')
                    },
                    remove: {
                        type: 'text',
						show: auth('CaseInfoModelViewSet:Delete')
                    },
                },
            },
			table: {
				rowKey: "id", //设置你的主键id， 默认rowKey=id
				onSelectionChange
			},
			columns: {
				$checked: {
					title: "选择",
					form: { show: false },
					column: {
					  type: "selection",
					  align: "center",
					  width: "55px",
					  columnSetDisabled: true, //禁止在列设置中选择
					  selectable(row: any, index: any) {
						return true;
					  }
					}
				},
				_index: {
                    title: '序号',
                    form: {show: false},
                    column: {
                        type: 'index',
                        align: 'center',
                        width: '70px',
                        columnSetDisabled: true, //禁止在列设置中选择
                    },
                },
				id: {
					title: "ID",
					key: "id",
					type: "text",
					show:false,
					column: {
					  width: 0
					},
					form: {
					  show: false
					}
				},
				disposal_subject: {
					title: '处置主体',
					type: 'dict-select',
					dict: dict({
                        url: '/api/DisposalSubjectModelViewSet/',
                        value: 'disposal_subject_id',
                        label: 'disposal_subject_name',
                    }),
					search: { show: true},
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {						
						rules: [{ required: true, message: '处置主体必填' }],
						component: {
							filterable: true,
							placeholder: '请输入处置主体',
						},
					},
				},
                commission_company: {
					title: '委案公司',
					type: 'dict-select',
					dict: dict({
                        url: '/api/PrincipalModelViewSet/',
                        value: 'id',
                        label: 'companyname',
                    }),			
					search: { show: true },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '委案公司必填' }],
						component: {
							placeholder: '请输入委案公司',
						},
					},
				},                
				commission_batch: {
					title: '委案批次',
					type: 'dict-select',
					dict: dict({
                        url: '/api/BatchModelViewSet/',
                        value: 'uuid',
                        label: 'casebatch',
                    }),			
					search: { show: true },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '委案批次必填' }],
						component: {
							placeholder: '请输入委案批次',
						},
					},
				},
                grouping: {
					title: '保全分组',
					type: 'text',
					search: { show: true },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '保全分组必填' }],
						component: {
							placeholder: '请输入保全分组',
						},
					},
				},
				commission_start_time:{
					title: '委案开始日期',
					type: "date",
					search: { show: false },
					column: {
						minWidth: 160,
						sortable: 'custom',
					},
					form: {
						format:"YYYY-mm-dd",
						valueFormat: "YYYY-mm-dd",
						rules: [{ required: true, message: '委案开始日期必填' }],
						component: {
							placeholder: '请输入委案开始日期',
						},
					},
					valueResolve({ row, key }) {						
						if (row[key] !=null && row[key] != undefined && row[key]!=""){
							row[key] = formatDate(row[key],"YYYY-mm-dd");
						}
					},					
				},
				commission_end_time:{
					title: '委案结束日期',
					type: 'date',
					search: { show: false },
					column: {
						minWidth: 160,
						sortable: 'custom',
					},
					form: {
						format:"YYYY-mm-dd",
						valueFormat: "YYYY-mm-dd",
						rules: [{ required: true, message: '委案结束日期必填' }],
						component: {
							placeholder: '请输入委案结束日期',
						},
					},
					valueResolve({ row, key }) {						
						if (row[key] !=null && row[key] != undefined && row[key]!=""){
							row[key] = formatDate(row[key],"YYYY-mm-dd");
						}
					},
				},
				product_name:{
					title: '产品名称',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '产品名称必填' }],
						component: {
							placeholder: '请输入产品名称',
						},
					},
				},
				case_no:{
					title: '真账号',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '真账号必填' }],
						component: {
							placeholder: '请输入真账号',
						},
					},
				},
				id_no:{
					title: '证件号',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '证件号必填' }],
						component: {
							placeholder: '请输入证件号',
						},
					},
				},
				name:{
					title: '姓名',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '姓名必填' }],
						component: {
							placeholder: '请输入姓名',
						},
					},
				},
				gender:{
					title: '性别',
					type: 'dict-select',
					dict: dict({
                        data: dictionary('gender'),
                    }),
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '性别必填' }],
						component: {
							placeholder: '请输入性别',
						},
					},
				},
				nation:{
					title: '民族',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '民族必填' }],
						component: {
							placeholder: '请输入民族',
						},
					},
				},
				residence_add:{
					title: '户籍地址',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '户籍地址必填' }],
						component: {
							placeholder: '请输入户籍地址',
						},
					},
				},
				phone:{
					title: '手机号',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '手机号必填' }],
						component: {
							placeholder: '请输入手机号',
						},
					},
				},
				contract_no:{
					title: '卡号',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '卡号必填' }],
						component: {
							placeholder: '请输入卡号',
						},
					},
				},
				account_opening_date:{
					title: '开户日',
					type: 'date',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						format:"YYYY-mm-dd",
						valueFormat: "YYYY-mm-dd",
						rules: [{ required: true, message: '开户日必填' }],
						component: {
							placeholder: '请输入开户日',
						},
					},
					valueResolve({ row, key }) {						
						if (row[key] !=null && row[key] != undefined && row[key]!=""){
							row[key] = formatDate(row[key],"YYYY-mm-dd");
						}
					},
				},
				card_suspension_day:{
					title: '停卡日',
					type: 'date',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						format:"YYYY-mm-dd",
						valueFormat: "YYYY-mm-dd",
						rules: [{ required: true, message: '停卡日必填' }],
						component: {
							placeholder: '请输入停卡日',
						},
					},					
					valueResolve({ row, key }) {						
						if (row[key] !=null && row[key] != undefined && row[key]!=""){
							row[key] = formatDate(row[key],"YYYY-mm-dd");
						}
					},
				},
				entry_reminder_date:{
					title: '入催日',
					type: 'date',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						format:"YYYY-mm-dd",
						valueFormat: "YYYY-mm-dd",
						rules: [{ required: true, message: '入催日必填' }],
						component: {
							placeholder: '请输入入催日',
						},
					},
					valueResolve({ row, key }) {						
						if (row[key] !=null && row[key] != undefined && row[key]!=""){
							row[key] = formatDate(row[key],"YYYY-mm-dd");
						}
					},
				},
				cal_overdue_days:{
					title: '逾期天数',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '逾期天数必填' }],
						component: {
							placeholder: '请输入逾期天数',
						},
					},
				},
				amount_owed:{
					title: '欠款总额',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '欠款总额必填' }],
						component: {
							placeholder: '请输入欠款总额',
						},
					},
				},
				principal:{
					title: '本金',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '本金必填' }],
						component: {
							placeholder: '请输入本金',
						},
					},
				},
				interest:{
					title: '利息',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '利息必填' }],
						component: {
							placeholder: '请输入利息',
						},
					},
				},
				default_money:{
					title: '违约金',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '违约金必填' }],
						component: {
							placeholder: '请输入违约金',
						},
					},
				},
				annual_fee:{
					title: '年费',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '年费必填' }],
						component: {
							placeholder: '请输入年费',
						},
					},
				},
				installment_handling_fee:{
					title: '分期手续费',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '分期手续费必填' }],
						component: {
							placeholder: '请输入分期手续费',
						},
					},
				},
				other_expenses:{
					title: '其它费用',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: false, message: '其它费用必填' }],
						component: {
							placeholder: '请输入其它费用',
						},
					},
				},
				data_time:{
					title: '取数日期',
					type: 'date',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						format:"YYYY-mm-dd",
						valueFormat: "YYYY-mm-dd",
						rules: [{ required: false, message: '取数日期必填' }],
						component: {
							placeholder: '请输入取数日期',
						},
					},
					valueResolve({ row, key }) {						
						if (row[key] !=null && row[key] != undefined && row[key]!=""){
							row[key] = formatDate(row[key],"YYYY-mm-dd");
						}
					},
				},
				application_time:{
					title: '申请表申请日期',
					type: 'date',
					search: { show: false },
					column: {
						minWidth: 160,
						sortable: 'custom',
					},
					form: {
						format:"YYYY-mm-dd",
						valueFormat: "YYYY-mm-dd",
						rules: [{ required: true, message: '申请表申请日期必填' }],
						component: {
							placeholder: '请输入申请表申请日期',
						},
					},
					valueResolve({ row, key }) {						
						if (row[key] !=null && row[key] != undefined && row[key]!=""){
							row[key] = formatDate(row[key],"YYYY-mm-dd");
						}
					},
				},
				acceptance_court:{
					title: '受理法院',
					type: 'dict-select',
					dict: dict({
                        url: '/api/CourtsModelViewSet/',
                        value: 'courtcode',
                        label: 'courtname',
                    }),
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '受理法院必填' }],
						component: {
							placeholder: '请输入受理法院',
						},
					},
				},
				current_stage:{
					title: '当前阶段',
					type: 'input',
					search: { show: true },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '当前阶段必填' }],
						component: {
							placeholder: '请输入当前阶段',
						},
					},
				},
				current_of:{
					title: '当前状态',
					type: 'input',
					search: { show: true },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '当前状态必填' }],
						component: {
							placeholder: '请输入当前状态',
						},
					},
				},
				preservation_amount:{
					title:'保全金额',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '保全金额必填' }],
						component: {
							placeholder: '请输入保全金额',
						},
					},
				},
				preservation_time:{
					title:'保全立案日',
					type: 'date',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						format:"YYYY-mm-dd",
						valueFormat: "YYYY-mm-dd",
						rules: [{ required: true, message: '保全立案日必填' }],
						component: {
							placeholder: '请输入保全立案日',
						},
					},
					valueResolve({ row, key }) {						
						if (row[key] !=null && row[key] != undefined && row[key]!=""){
							row[key] = formatDate(row[key],"YYYY-mm-dd");
						}
					},
				},
				preservation_case:{
					title:'保全案号',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '保全案号必填' }],
						component: {
							placeholder: '请输入保全案号',
						},
					},
				},
				handle_case:{
					title:'执保案号',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: false, message: '执保案号必填' }],
						component: {
							placeholder: '请输入执保案号',
						},
					},
				},
				relieve_case:{
					title:'解除保全案号',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 140,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: false, message: '解除保全案号必填' }],
						component: {
							placeholder: '请输入解除保全案号',
						},
					},
				},
				relieve_case_time:{
					title:'解除保全日',
					type: 'date',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						format:"YYYY-mm-dd",
						valueFormat: "YYYY-mm-dd",
						rules: [{ required: false, message: '解除保全日必填' }],
						component: {
							placeholder: '请输入解除保全日',
						},
					},
					valueResolve({ row, key }) {						
						if (row[key] !=null && row[key] != undefined && row[key]!=""){
							row[key] = formatDate(row[key],"YYYY-mm-dd");
						}
					},
				},
				mediation_organization_name:{
					title:'调解组织名称',
					type: 'dict-select',
					dict: dict({
                        url: '/api/MediationModelViewSet/',
                        value: 'uuid',
                        label: 'mediatename',
                    }),
					search: { show: false },
					column: {
						minWidth: 140,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: false, message: '调解组织名称必填' }],
						component: {
							placeholder: '请输入调解组织名称',
						},
					},
				},
				mediators_name:{
					title:'调解员姓名',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '调解员姓名必填' }],
						component: {
							placeholder: '请输入调解员姓名',
						},
					},
				},
				mediators_phone:{
					title:'调解员电话',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: true, message: '调解员电话必填' }],
						component: {
							placeholder: '请输入调解员电话',
						},
					},
				},
				mediators_wx:{
					title:'调解员微信',
					type: 'input',
					search: { show: false },
					column: {
						minWidth: 120,
						sortable: 'custom',
					},
					form: {
						rules: [{ required: false, message: '调解员微信必填' }],
						component: {
							placeholder: '请输入调解员微信',
						},
					},
				},
			},
			method:{
				handleCommand:(command: string | number | object) => {					
					switch(command){
						case "a":
							
							break;
						case "b":
							const modal = ElMessageBox({
								title: "批量导入",
								confirmButtonText: "关闭",
								message() {
								  async function onChange(e: { target: { files: any[]; }; }) {
									const file = e.target.files[0];
									await importTable(crudExpose, { file, append: true });
									// modal.destroy();
									ElMessage.success("导入成功");
								  }
								  return (
									<div>
									  <p>
										1、<a href={"#"}>下载导入模板</a>
									  </p>									  
									  <p>
										<span>2、导入：</span>
										<input type={"file"} onInput={onChange}></input>
									  </p>
									</div>
								  );
								}
							  });
							break;
						case "c":
							break;
						case "d":
							break;
						case "e":
							break;
						case "f":
							break;
						case "g":
							break;
						case "h":
							break;
						case "i":
							break;
						case "j":
							break;
						case "k":
							break;
						case "l":
							break;
						case "m":
							break;
						case "n":
							break;
						case "o":
							break;
						case "p":
							break;
						case "q":
							break;
						case "r":
							break;
						case "s":
							break;
					}
				},
				batchModify:async()=>{
					if (selectedIds.value?.length > 0){
						await openCustomForm(selectedIds.value);
					}else{
						ElMessage.error("请先勾选记录");
					}					
				},
				batchGroup:async()=>{
					if (selectedIds.value?.length > 0){
						await openBatchGroupForm(selectedIds.value);
					}else{
						ElMessage.error("请先勾选记录");
					}					
				}
			}
		},
	};
};